#include "AE.h"

IAnimatedMeshSceneNode* makeAnimatedSimpleObject(const c8 *meshFilePath, const c8 *textureFilePath, bool dynamicLighting, 
ISceneNode*parent, vector3df scale, bool animate, 
bool loopAnim, s32 frameLoopStrt, s32 frameLoopEnd,f32 animFPS)
{

	IAnimatedMeshSceneNode* Object = smgr->addAnimatedMeshSceneNode(smgr->getMesh(meshFilePath));
	Object->setMaterialTexture(0, driver->getTexture(textureFilePath));
	Object->setLoopMode(loopAnim);
	if (!dynamicLighting) Object->setMaterialFlag(video::EMF_LIGHTING, false);
	//Object->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, false);
	
	if (animate)
	{
	if (frameLoopStrt != -1 && frameLoopEnd!= -1)Object->setFrameLoop(frameLoopStrt, frameLoopEnd);
	if (animFPS!=-1)Object->setAnimationSpeed(animFPS);
	
	}
	else{Object->setAnimationSpeed(f32(0));}

	Object->setScale(scale);
	if (parent!=0)Object->setParent(parent);
	return Object;
}
